package bom.example.common.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author X.I.O
 * @title: ListUtils
 * @projectName springboot
 * @description: TODO
 * @date 2021/10/27 10:00
 *
 * list工具类使用
 */
public class ListUtils {


    public static String[] getStringArrays(List<String> strings){
        String[] stringArray=new String[strings.size()];
        strings.toArray(stringArray);
        return stringArray;
    }

    /**
     * 合并两个list
     * @param strings_1
     * @param strings_2
     * @return
     */
    public static List<String> mergeTwoList(List<String> strings_1,List<String> strings_2){
        int size=(strings_1.size()+strings_2.size());
        List<String> strings=new ArrayList<>(size);
        strings.addAll(strings_1);
        strings.addAll(strings_2);
        return strings;
    }
}
